﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="Locadora.Views.Home.Index" %>
<%@ Import Namespace="System.Web.Mvc.Html" %>
<%@ Import Namespace="MvcMembership.Helpers" %>
<%@ Import Namespace="TagCloud" %>

<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
    <script src="../../Content/javascript/jquery-1.2.3.min.js" type="text/javascript"></script>
    <div class="corpo">
    <h2>Seu sistema de locação de vídeos</h2>
    <div class="notes" style="background-color:#ffffff">
    <form id="frmTagcloud" method=get>
            <h1>Tags</h1> 
            <%=Html.TagCloud((Dictionary<string, int>)ViewData["Locacoes"], new TagCloudGenerationRules { Order = TagCloudOrder.Random, TagToolTipFormatString = "Locações: {0}", TagUrlFormatString = "/Filme/LocacaoNome/0?nome={0}" })%>    
            </form>
    </div>
        
    <% if (ViewData["ErrorMessage"] != null)
        { %>
            Ocorreu um erro:
            <br />
            <%= ViewData["ErrorMessage"] %>
            <br />
        <% } %>
        
        <!--
            <form id="contact-form" action="<%= Html.AttributeEncode(Url.Action("Index")) %>" method="post">
                <input type=submit value=enviar />
            </form>ViewData["Locacoes"]
        -->
    </div>
    
    <script type="text/javascript">
        $(document).ready(function() {
            //
            //
//            $('#contact-form').submit(
//            function() {
//                var f = $('#contact-form');
//                var action = f.attr("action");
//                var serializedForm = f.serialize();
//                $.post(action,
//                    serializedForm,
//                    function() {
//                        //alert('voltou');
//                        $("#corpo").html('Updated!');
//                    });
//                return false;
//            });

//            jQuery().ajaxStart(function() {
//                $("#contact-form").fadeOut("slow");
//            });

//            jQuery().ajaxStop(function() {
//                $("#contact-form").fadeIn("fast");
//            });

//            $('#contact-form').submit(
//            function() {
//                var t = $("#contact-form").parent().siblings(0).val();
//                $.post("/Home/Index", {
//                    content: t
//                }, function(txt) {
//                    $("#indexContent").html(txt);
//                });
//                return false;
//            });

        });
    </script>
</asp:Content>
